<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Update.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<%--<link rel="stylesheet" type="text/css" href="css/addplay.css">--%>
	  <script type="text/javascript" src="/statics/js/jquery-1.12.4.js"></script>
	<script type="text/javascript">

    $(document).ready(function() {
        $("#save").click(function(){
            var id=$("#ID").val();
            var stdNum=$("#stdnum").val();
            var zhname=$("#zhname").val();
            var version=$("#ver").val();
            var keys=$("#keyes").val();
            var releaseDate=$("#releasedate").val();
            var implDate=$("#impldate").val();
            var packagePath=$("#packagepath").val();
            $.ajax({

                url:"/user/updateSave.html",
                data:{
                    "id":id,
                    "stdNum":stdNum,
                    "zhname":zhname,
                    "version":version,
                    "keys":keys,
                    "releaseDate":releaseDate,
                    "implDate":implDate,
                    "packagePath":packagePath,
                },
                success:function(data){
                        alert("修改成功");
                        window.location.href="${pageContext.request.contextPath }/user/show.html";
                },
                dataType:"json"
            })
		})

	})
	
	</script>
  </head>
  
  <body>
    <form>
		<table border="1">
			<tr>
				<td class="no1">*标志号</td>
				<td><input type="text" class="text" id="stdnum" name="stdnum" value="${standards.stdnum}"/></td>
			</tr>
			<tr>
				<td class="no1">*中文号</td>
				<td><input type="text" class="text" id="zhname" name="zhname" value="${standards.zhname}"/></td>
			</tr>
			<tr>
				<td class="no1">*版本</td>
				<td><input type="text" class="text" id="ver" name="ver" value="${standards.ver}"/></td>
			</tr>
			<tr>
				<td class="no1">*关键字</td>
				<td><input type="text" class="text" id="keyes" name="keyes" value="${standards.keyes}"/></td>
			</tr>
			<tr>
				<td class="no1">发布日期（yyyy-MM-dd）</td>
				<td><input type="text" class="text" id="releasedate"
					name="releasedate" value='<fmt:formatDate value="${standards.releasedate}" pattern="yyyy-MM-dd" />'/></td>
			</tr>
			<tr>
				<td class="no1">实施日期（yyyy-MM-dd）</td>
				<td><input type="text" class="text" id="impldate"
					name="impldate" value='<fmt:formatDate value="${standards.impldate}" pattern="yyyy-MM-dd" />'/></td>
			</tr>
			<tr>
				<td class="no1">*附件</td>
				<td><input type="file" class="text" id="packagepath"
					name="packagepath" value="${standards.packagepath}"/></td>
			</tr>
			<tr>
				<td colspan="2" class="last"><input type="button" id="save"
					value="保存" /> <input type="button" id="back" value="取消" onclick="javascript:history.back(-1);"/></td>
			</tr>
		</table>
		<input type="hidden" id="ID" value="${standards.id}"/>
	</form>
    
  </body>
</html>
